package com.example.demo.controller;


import com.example.demo.model.result;
import com.example.demo.services.ArticleSecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/articleSec")
public class ArticleSecController {

    @Autowired
    private ArticleSecService service;



    @GetMapping("/getAll")
    public result getAll(){
        return result.success(service.selectAll());
    }


    /**
     * 这个为指定文章的评论
     * @param id 对应的文章id
     * @return
     */
    @GetMapping("/getId")
    public result getId(Integer id){
        return result.success(service.selectId(id));
    }


}
